import React, { forwardRef } from 'react';
import MemberSelectNative from './MemberSelect';
import service from './service';

export { TabKey, ServiceTabKey, tabsData } from './utils/consts';
export { decorateKey, getTabKeyByData, genKey, getServiceTabKey, getMemberIconByKey } from './utils';
export { positionSelector } from './utils/operations';

const { search } = service;
export { search };

const MemberSelect: React.ForwardRefRenderFunction<React.Ref<any>, TMemberSelect.IProps> = (
  props,
  ref,
) => {
  return <MemberSelectNative {...props} ref={ref} />;
};

export function useMemberSelect(config: TMemberSelect.IProps) {
  return React.createElement(forwardRef(MemberSelect), config);
}

export { MemberSelectedTagView, MemberSelectedView } from './MemberSelect';

export default forwardRef(MemberSelect);
